﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestSystem.Domain.Abstract;
using TestSystem.Domain.DAL;
using TestSystem.Domain.Entities.Candidate;

namespace TestSystem.Domain.Repositories
{
    public class CandidateRepository : ICandidateRepository
    {
        private TestSystemContext dbContext = new TestSystemContext();

        public IQueryable<Candidate> Candidates { get { return dbContext.Candidates; } }
        public void AddCandidate(Candidate candidate)
        {
            dbContext.Candidates.Add(candidate);
            dbContext.SaveChanges();
        }

        public void RemoveCandidate(Candidate candidate)
        {
            dbContext.Candidates.Remove(candidate);
            dbContext.SaveChanges();
        }
    }
}
